package com.topscomm.mis.cbb.pm.controller.auto;

import com.topscomm.mis.cbb.pm.controller.CbbPmController;
import com.topscomm.mis.cbb.pm.service.impl.TaskService;
import com.topscomm.pub.vo.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class CbbPmTaskControllerAuto extends CbbPmController {
    @GetMapping(value = "/dataCodeList")
    public ResponseResult<Object> dataCodeList(@RequestParam(required = false) Map<String, Object> paraMap) {
        Map<String, Object> codeMap = new HashMap<String, Object>();
        List<Map<String, Object>> taskRelationList = datacodeCache.getCodeListMap("CbbPmTaskRelation", "", "sortcode");
        codeMap.put("taskRelationList", taskRelationList);
        List<Map<String, Object>> taskTypeList = datacodeCache.getCodeListMap("CbbPmTaskType", "", "sortcode");
        codeMap.put("taskTypeList", taskTypeList);
        List<Map<String, Object>> taskStatusList = datacodeCache.getCodeListMap("CbbPmTaskStatus", "", "sortcode");
        codeMap.put("taskStatusList", taskStatusList);
        List<Map<String, Object>> taskSourceList = datacodeCache.getCodeListMap("CbbPmTaskSource", "", "sortcode");
        codeMap.put("taskSourceList", taskSourceList);
        List<Map<String, Object>> taskRunningStateList = datacodeCache.getCodeListMap("CbbPmTaskRunningState", "", "sortcode");
        codeMap.put("taskRunningStateList", taskRunningStateList);
        List<Map<String, Object>> enabledList = datacodeCache.getCodeListMap("CboYesNo", "", "sortcode");
        codeMap.put("enabledList", enabledList);
        List<Map<String, Object>> autocompleteList = datacodeCache.getCodeListMap("CbbPmAutoComplete", "", "sortcode");
        codeMap.put("autocompleteList", autocompleteList);
        return ResponseResult.ok(codeMap);
    }
}
